Skip to content

docs: Correct quiver and streamline figure factory return types - #5823

Merged
camdecoster merged 2 commits into
plotly:mainfrom
senanurcetin:docs/figure-factory-returns-5396
Oct 20, 2026
Merged

camdecoster merged 2 commits into
plotly:mainfrom
senanurcetin:docs/figure-factory-returns-5396

Conversation

@senanurcetin

@senanurcetin senanurcetin commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Related to #5396.

The documentation for create_quiver() and create_streamline() incorrectly described their return type as dict, although both functions return plotly.graph_objects.Figure.

This PR:

  • Corrects the return types using Plotly's existing Sphinx :rtype documentation style.
  • Updates both function summaries to describe the returned figure accurately.
  • Preserves all runtime behavior and the public API.

Maintainer review addressed

Thank you to @camdecoster for the review.

Commit 0b3cf5e addresses the requested changes:

  • Replaced the NumPy-style Returns blocks with Sphinx return-type directives.
  • Removed the documentation-only regression test file.

Only the two existing figure-factory source files remain changed.

Verification

The earlier commit 1cd3b20 passed 24 targeted tests, including tests from the documentation-only file that has since been removed.

These historical results do not constitute full verification of the updated head. Upstream GitHub Actions are awaiting maintainer authorization.

AI assistance

AI assistance was used in preparing and reviewing this documentation change. I remain responsible for the contribution and for addressing reviewer feedback.

@camdecoster camdecoster self-assigned this Oct 19, 2026

@camdecoster camdecoster left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this fix. Could you please stick with the Sphinx style docstrings? I'd like to avoid mixing the styles.

Comment thread plotly/figure_factory/_quiver.py Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Returns a figure for a quiver plot.

Comment thread plotly/figure_factory/_quiver.py Outdated
Comment on lines +30 to +33
Returns
-------
plotly.graph_objects.Figure
A Plotly figure containing the quiver arrows.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Returns
-------
plotly.graph_objects.Figure
A Plotly figure containing the quiver arrows.
:rtype (plotly.graph_objects.Figure): returns a representation of quiver figure.

Comment thread plotly/figure_factory/_streamline.py Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Returns a figure for a streamline plot.

Comment thread plotly/figure_factory/_streamline.py Outdated
Comment on lines +58 to +61
Returns
-------
plotly.graph_objects.Figure
A Plotly figure containing the streamlines and arrows.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Returns
-------
plotly.graph_objects.Figure
A Plotly figure containing the streamlines and arrows.
:rtype (plotly.graph_objects.Figure): returns a representation of streamline figure.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this file. We don't add tests for docstrings.

@senanurcetin

Copy link
Copy Markdown
Contributor Author

Hi @camdecoster,

Thank you for the review. I've addressed your requested changes in commit 0b3cf5e: both return types now use the existing Sphinx :rtype style, and the documentation-only test file has been removed.

I've also updated the PR description to reflect the current scope.

Could you please take another look when convenient? The GitHub Actions checks are still awaiting maintainer authorization.

Thank you!

@senanurcetin

Copy link
Copy Markdown
Contributor Author

Hi @camdecoster,

I've reviewed the remaining CI failures on PR #5823.

Changelog check: This PR only corrects existing docstrings. Could a maintainer add the no-changelog label if a changelog entry isn't required?

Optional tests (Python 3.9 / pandas 1): The failure occurs in test_kaleido.py::test_defaults, with ReferenceError: Plotly is not defined in Kaleido's JavaScript environment. The other test jobs passed, and this PR doesn't modify Kaleido or rendering behavior.

The previously requested docstring changes have also been applied.

Please let me know if any further changes are needed.

Thank you!

@camdecoster camdecoster added the no-changelog A changelog entry is not required for this PR label Oct 20, 2026
@camdecoster camdecoster changed the title DOC: Correct quiver and streamline figure factory return types docs: Correct quiver and streamline figure factory return types Oct 20, 2026
@camdecoster
camdecoster merged commit 224e133 into plotly:main Oct 20, 2026
30 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog A changelog entry is not required for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants